<?php

namespace App\Commons\Providers;

use Illuminate\Support\ServiceProvider;
use Symfony\Component\Finder\Finder;

class ConfigServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
    }

    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        $finder = app(Finder::class);
        $finder->files()->name('*.php')->in(__DIR__. '/../Config/');
        foreach ($finder as $file) {
            $this->mergeConfigFrom($file->getPathname(), str_replace('.php', '', $file->getFilename()));
        }
    }
}
